package com.hxzy.common.vo;

/**
 * 所有返回状态码和消息
 * @author nick
 */
public enum ResultEnum {

    OK(0,"成功"),
    ERROR(500, "失败"),
    DB_SUCCESS(0,"数据库操作成功"),
    DB_FAILED(501,"数据库操作失败"),
    VALUE_IS_USED(0,"该值已被占用"),
    PARAMS_NOT_EMPTY(502, "参数值不能为空"),
    TOKEN_EMPTY(50008,"令牌无效"),
    TOKEN_TAMPERING(50008,"令牌被窜改"),
    TOKEN_EXPIRED(50014,"令牌已过期"),
    Forbidden(403,"没有权限进行此项操作"),
    // 50x
    UN_LOGIN(501,"请登录后再继续操作！"),
    TICKET_INVALID(502,"会话失效，请重新登录！"), 
    MOBILE_ERROR(504,"短信发送失败，请稍后重试！"),
    SMS_NEED_WAIT_ERROR(505,"短信发送太快啦~请稍后再试！"),
    SMS_CODE_ERROR(506,"验证码过期或不匹配，请稍后再试！"),
    USER_FROZEN(507,"用户已被冻结，请联系管理员！"),
    USER_UPDATE_ERROR(508,"用户信息更新失败，请联系管理员！"),
    USER_INACTIVE_ERROR(509,"请前往[账号设置]修改信息激活后再进行后续操作！"),
    FILE_UPLOAD_NULL_ERROR(510,"文件不能为空，请选择一个文件再上传！"),
    FILE_UPLOAD_FAILD(511,"文件上传失败！"),
    FILE_FORMATTER_FAILD(512,"文件图片格式不支持！"),
    FILE_MAX_SIZE_ERROR(513,"仅支持500kb大小以下的图片上传！"),
    FILE_NOT_EXIST_ERROR(514,"你所查看的文件不存在！"),
    USER_STATUS_ERROR(515,"用户状态参数出错！"),
    USER_NOT_EXIST_ERROR(516,"用户不存在！"),

    // 自定义系统级别异常 54x
    SYSTEM_INDEX_OUT_OF_BOUNDS(541, "系统错误，数组越界！"),
    SYSTEM_ARITHMETIC_BY_ZERO(542, "系统错误，无法除零！"),
    SYSTEM_NULL_POINTER(543, "系统错误，空指针！"),
    SYSTEM_NUMBER_FORMAT(544, "系统错误，数字转换异常！"),
    SYSTEM_PARSE(545, "系统错误，解析异常！"),
    SYSTEM_IO(546, "系统错误，IO输入输出异常！"),
    SYSTEM_FILE_NOT_FOUND(547, "系统错误，文件未找到！"),
    SYSTEM_CLASS_CAST(548, "系统错误，类型强制转换错误！"),
    SYSTEM_PARSER_ERROR(549, "系统错误，解析出错！"),
    SYSTEM_DATE_PARSER_ERROR(550, "系统错误，日期解析出错！"),

    // 系统错误，未预期的错误 555
    SYSTEM_ERROR(555, "系统繁忙，请稍后再试！"),
    SYSTEM_OPERATION_ERROR(556, "操作失败，请重试或联系管理员"),
    SYSTEM_RESPONSE_NO_INFO(557, "");
    ;

    private int code;
    private String message;

    ResultEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }


    public String getMessage() {
        return message;
    }

 }
